package com.realife.mbplustest.controller;


import com.realife.mbplustest.entity.TbCategory;
import com.realife.mbplustest.service.TbCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品类目表，类目和商品(spu)是一对多关系，类目与品牌是多对多关系 前端控制器
 * </p>
 *
 * @author Albert
 * @since 2020-05-30
 */
@RestController
@RequestMapping("/category")
public class TbCategoryController {

    @Autowired
    private TbCategoryService tbCategoryService;


    @RequestMapping("/test1")
    public ResponseEntity<List<TbCategory>> test1() {

        return ResponseEntity.ok(this.tbCategoryService.queryAllCategory());
    }
}

